package main

import (
	"github.com/gin-gonic/gin"
	"go-barrage/controller"
)

func CollectRoute(r *gin.Engine) *gin.Engine {

	indexGroup := r.Group("index")
	{
		indexGroup.GET("", controller.Index)
	}

	userGroup := r.Group("user")
	{
		userGroup.POST("register", controller.Register)
		userGroup.POST("login", controller.Login)
	}

	//r.Use(middleware.VerifyToken)

	video := r.Group("video")
	{
		video.GET("", controller.GetVideoInfos)
		video.GET("/:videoShortId", controller.GetVideoDetail)
	}

	barrageMsg := r.Group("barrage/msg")
	{
		barrageMsg.POST("list", controller.GetBarrageMsgList)
	}
	return r
}
